package com.android.project.games;

import com.android.project.framework.Music;
import com.android.project.framework.Sound;
import com.android.project.framework.gl.Font;
import com.android.project.framework.gl.Texture;
import com.android.project.framework.gl.TextureRegion;
import com.android.project.framework.impl.GLGame;


public class Assets {
	public static Texture background;
	public static TextureRegion backgroundRegion;
	public static Font font;
	public static Texture items;
	public static TextureRegion labelInsertRegion;
	public static TextureRegion playRegion;
	public static TextureRegion highRegion;
	public static TextureRegion helpRegion;
	public static TextureRegion backRegion;
	public static TextureRegion forwardRegion;
	public static TextureRegion logo;
	public static TextureRegion soundOff;
	public static TextureRegion soundOn;
	public static TextureRegion gameOverRegion;
	public static TextureRegion labelRightRegion;
	public static TextureRegion labelWrongRegion;
	public static TextureRegion labelRegion;
	public static TextureRegion quitRegion;
	public static TextureRegion resumeRegion;
	public static TextureRegion clickRegion;
	public static TextureRegion pauseRegion;
	public static TextureRegion labelSemiRegion;
	public static TextureRegion levelEnd;
	public static TextureRegion scoreRegion;
	public static TextureRegion facebook;
	public static TextureRegion twitter;
	public static TextureRegion right;
	public static TextureRegion wrong;
	public static TextureRegion line;
	public static TextureRegion network;
	
	public static Music music;
	public static Sound clickSound;
	public static Sound rightSound;
	public static Sound wrongSound;
	public static Sound guillotineSound;
	public static Sound semiSound;
	public static TextureRegion social;
	public static TextureRegion high;
	public static TextureRegion hightText;
	public static TextureRegion faceIconRegion;
	public static TextureRegion tweetIconRegion;
	
	
	public static void load(GLGame game){
		background = new Texture(game, "sfondo.png");
		items = new Texture(game, "items.png");
		backgroundRegion = new TextureRegion(background, 0, 0, 320, 480);
		backRegion = new TextureRegion(items, 905, 0, 64 ,64);
		clickRegion = new TextureRegion(items, 592 ,353, 128, 50);
		facebook = new TextureRegion(items, 301, 456, 160, 36);
		faceIconRegion = new TextureRegion(items, 970, 0,48, 48);
		font = new Font(items,602, 173, 16, 16, 20);
		forwardRegion = new TextureRegion(items, 891, 66 , 64, 64);
		gameOverRegion = new TextureRegion(items, 592, 302, 236, 50);
		helpRegion = new TextureRegion(items,315, 0 , 300, 36);
		high = new TextureRegion(items, 0 ,59 , 300, 220);
		highRegion = new TextureRegion(items, 315, 37, 300, 36);
		hightText = new TextureRegion(items, 301, 230, 293, 64);
		labelInsertRegion =  new TextureRegion(items, 616, 0  ,288, 32);
		labelRightRegion = new TextureRegion(items,616, 33, 288 ,32);
		labelWrongRegion = new TextureRegion(items, 602, 74,288, 32);
		labelRegion = new TextureRegion(items, 602, 107, 288 ,32);
		labelSemiRegion = new TextureRegion(items,602, 140, 288, 32);
		
		levelEnd = new TextureRegion(items, 301, 295  , 290 ,160);
		line = new TextureRegion(items,301, 59 , 3, 6);
		logo = new TextureRegion(items,0, 0  , 314, 58);
		
		network = new TextureRegion(items, 0, 280 , 300, 200);
		
		pauseRegion = new TextureRegion(items,859, 180, 32, 32);
		
		
		playRegion = new TextureRegion(items,301, 74, 300, 36);
		quitRegion = new TextureRegion(items,301, 111, 300 ,36);
		resumeRegion = new TextureRegion(items,301, 148 , 300, 36);
		right = new TextureRegion(items, 592, 404, 48, 48);
		scoreRegion = new TextureRegion(items,0,481 , 79, 24);
		
		social = new TextureRegion(items, 301 ,185 ,294, 44);
		
		
		soundOff = new TextureRegion(items,970, 49, 48, 48);
		soundOn = new TextureRegion(items, 641, 404, 48, 48);
		twitter = new TextureRegion(items, 462, 456 , 160, 36);
		tweetIconRegion = new TextureRegion(items,891, 131, 48, 48);
		
		wrong = new TextureRegion(items,956, 98, 48, 48);
	
		
		
		
		clickSound = game.getAudio().newSound("click.ogg");
		rightSound = game.getAudio().newSound("right.ogg");
		wrongSound = game.getAudio().newSound("wrong.ogg");
		
		//guillotineSound = game.getAudio().newSound("guillotine.ogg");
		
		semiSound = game.getAudio().newSound("Oh.ogg");
		
		music = game.getAudio().newMusic("akiko.mp3");
		music.setVolume(0.2f);
		music.setLooping(true);
		if(Settings.soundEnabled)
			music.play();
		
	
		
	
	}
	
	public static void reload() {
		background.reload();
		items.reload();
		if(Settings.soundEnabled)
			music.play();
	}
	
	public static void playSound(Sound sound) {
		if(Settings.soundEnabled)
			sound.play(1);
		
	}
}
